Дневник
« 1 2 3 4 5 6 ... 12 13 »
struct Sleeper : private QThread
{
static void msleep(unsigned long msecs) { QThread::msleep(msecs); }
};
Sleeper::msleep(500);
Просмотров: 1447 |
Добавил: qt-boy |
Дата: 18.11.2010
|
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QtGui/QMainWindow>
namespace Ui
{
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent =
...
Читать дальше »
Просмотров: 7739 |
Добавил: qt-boy |
Дата: 16.11.2010
|
#include <sys/vfs.h> #include <sys/stat.h> qulonglong getFreeSpace(const QString &path) { QString apath = QDir(path).absolutePath(); struct stat stst; struct statfs stfs; if (::stat(apath.toLocal8Bit(),&stst) == -1) { return 0; } if (::statfs(apath.toLocal8Bit(),&stfs) == -1) { return 0; } return stfs.f_bavail * (stst.st_blksize);  
...
Читать дальше »
Просмотров: 1031 |
Добавил: qt-boy |
Дата: 16.11.2010
|
Заголовки: #include <QMouseEvent>
#include <QRubberBand>
#include <QPoint>
Приватные члены классы: QPoint origin;
QRubberBand *rubberBand;
Защищенные члена класса: protected:
void mouseMoveEvent(QMouseEvent *event);
void mousePressEvent(QMouseEvent *event);
void mouseReleaseEvent(QMouseEvent *event);
Реализация методов: void MainWindow::mousePressEvent(QMouseEvent *event)
{
origin = event->pos();
rubberBand = new QRubberBand(QRubberBand::Rectangle, this);
rubberBand->setGeometry(QRect(origin, QSize()));
rubberBand->show();
}
void MainWindow::mouseMoveEvent(QMouseEvent *event)
{
&nbs
...
Читать дальше »
Просмотров: 3631 |
Добавил: qt-boy |
Дата: 12.11.2010
|
virtual void dragEnterEvent(QDragEnterEvent *pe); virtual void dropEvent(QDropEvent *pe); void MainWindow::dragEnterEvent(QDragEnterEvent *pe) { if (pe->mimeData()->hasFormat("text/uri-list")) { pe->acceptProposedAction(); } } void MainWindow::dropEvent(QDropEvent *pe) { QList<QUrl> urlList = pe->mimeData()->urls(); ui->lineEdit->setText(urlList.at(0).toString()); }
Просмотров: 1021 |
Добавил: qt-boy |
Дата: 12.11.2010
|
QShortcut* shortcut = new QShortcut(QKeySequence(Qt::Key_Escape), this); connect(shortcut, SIGNAL(activated()), this, SLOT(deselectRows()));
Просмотров: 1063 |
Добавил: admin |
Дата: 04.11.2010
|
Linux: showFullScreen(); Windows: widget->setWindowFlags(Qt::WindowStaysOnTopHint | Qt::Tool);
Просмотров: 1267 |
Добавил: admin |
Дата: 03.11.2010
|
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QSplashScreen *splash =
new QSplashScreen(QPixmap::fromMimeSource("splash.png"));
splash->show();
splash->message(QObject::tr("Setting up the main window..."),
Qt::AlignRight | Qt::AlignTop, Qt::white);
MainWindow mainWin;
app.setMainWidget(&mainWin);
splash->message(QObject::tr("Loading modules..."),
Qt::AlignRight | Qt::AlignTop, Qt::white);
loadModules();
splash->message(QObject::tr("Establishing connections..."),
Qt::AlignRight | Qt::AlignTop, Qt::white);
establishConnections();
mainWin.show();
splash->finish(&mainWin);
delete splash;
return app.exec();
}
Просмотров: 1724 |
Добавил: qt-boy |
Дата: 12.09.2010
|
void MainWindow::writeSettings()
{
QSettings settings;
settings.setPath("software-inc.com", "Spreadsheet");
settings.beginGroup("/Spreadsheet");
settings.writeEntry("/geometry/x", x());
settings.writeEntry("/geometry/y", y());
settings.writeEntry("/geometry/width", width());
settings.writeEntry("/geometry/height", height());
settings.writeEntry("/recentFiles", recentFiles);
settings.writeEntry("/showGrid", showGridAct->isOn());
settings.writeEntry("/autoRecalc", showGridAct->isOn());
settings.endGroup();
} void MainWindow::readSettings()
{
QSettings settings;
settings.setPath("software-inc.com", "Spreadsheet");
settings.beginGroup("/Spreadsheet");
int x = settings.readNumEntry("/geometry/x", 200);
int y = settings.readNumEntry("/geometry/y", 200);
int w = settings.readNumEntry("/geometry/width", 400);
int h = settings.readNumEntry("/geometry/height", 400);
move(x, y);
resize(w, h);
recentFiles = settings.re
...
Читать дальше »
Просмотров: 1566 |
Добавил: qt-boy |
Дата: 12.09.2010
|
QByteArray ba
= agent_directory
. toLatin1
();
char * c_str2 = ba. data();
...
Читать дальше »
Просмотров: 1390 |
Добавил: qt-boy |
Дата: 26.08.2010
|
Календарь « Май 2024 » Пн Вт Ср Чт Пт Сб Вс 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
Статистика
Онлайн всего: 1
Гостей: 1
Пользователей: 0