本文整理汇总了C++中setAcceptDrops函数的典型用法代码示例。如果您正苦于以下问题:C++ setAcceptDrops函数的具体用法?C++ setAcceptDrops怎么用?C++ setAcceptDrops使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setAcceptDrops函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setAttribute
void GLCanvas::initializeGL() {
setAttribute(Qt::WA_AcceptTouchEvents);
setAcceptDrops(true);
// Note, we *DO NOT* want Qt to automatically swap buffers for us. This results in the "ringing" bug mentioned in WL#19514 when we're throttling the framerate.
setAutoBufferSwap(false);
}
示例2: QWidget
//.........这里部分代码省略.........
//
line_outcue_label=new QLabel(this);
line_outcue_label->setGeometry(5,48, (sizeHint().width()/2 -10),16);
line_outcue_label->setFont(outcue_font);
line_outcue_label->hide();
//
// Artist
//
line_artist_label=new QLabel(this);
line_artist_label->setGeometry(5,33,sizeHint().width()-10,16);
line_artist_label->setFont(line_font);
//
// Title
//
line_title_label=new QLabel(this);
line_title_label->setGeometry(5,18,sizeHint().width()-10,18);
line_title_label->setFont(line_bold_font);
//
// Marker Comment
//
line_comment_label=new RDLabel(this);
line_comment_label->setGeometry(5,18,sizeHint().width()-10,62);
line_comment_label->setFont(line_font);
line_comment_label->setAlignment(AlignTop|AlignLeft);
line_comment_label->setWordWrapEnabled(true);
line_comment_label->hide();
//
// Icon
//
line_icon_label=new QLabel(this);
line_icon_label->setGeometry(5,3,45,16);
//
// Cart
//
line_cart_label=new QLabel(this);
line_cart_label->setGeometry(25,3,53,16);
line_cart_label->setFont(line_font);
//
// Cut
//
line_cut_label=new QLabel(this);
line_cut_label->setGeometry(80,3,24,16);
line_cut_label->setFont(line_font);
//
// Group
//
line_group_label=new QLabel(this);
line_group_label->setGeometry(107,3,75,16);
line_group_label->setFont(line_bold_font);
//
// Time
//
line_time_label=new QLabel(this);
line_time_label->setGeometry(185,3,70,16);
line_time_label->setFont(line_font);
line_time_label->setAlignment(AlignRight);
line_time_label->setPalette(line_time_palette);
//
// Talk Time
//
line_talktime_label=new QLabel(this);
line_talktime_label->setGeometry(257,3,36,16);
line_talktime_label->setFont(talk_font);
line_talktime_label->setAlignment(AlignRight);
//
// Length
//
line_length_label=new QLabel(this);
line_length_label->setGeometry(297,3,40,16);
line_length_label->setFont(line_font);
line_length_label->setAlignment(AlignRight);
//
// Transition Type
//
line_trans_label=new QLabel(this);
line_trans_label->setGeometry(sizeHint().width()-53,3,48,16);
line_trans_label->setAlignment(AlignRight);
line_trans_label->setFont(line_bold_font);
SetColor(QColor(LOGLINEBOX_BACKGROUND_COLOR));
//
// Countdown Timer
//
line_countdown_timer=new QTimer(this);
connect(line_countdown_timer,SIGNAL(timeout()),this,SLOT(countdownData()));
setAcceptDrops(true);
}
示例3: QMainWindow
BitcoinGUI::BitcoinGUI(const NetworkStyle *networkStyle, QWidget *parent) :
QMainWindow(parent),
clientModel(0),
walletFrame(0),
unitDisplayControl(0),
labelEncryptionIcon(0),
labelConnectionsIcon(0),
labelBlocksIcon(0),
progressBarLabel(0),
progressBar(0),
progressDialog(0),
appMenuBar(0),
overviewAction(0),
historyAction(0),
quitAction(0),
sendCoinsAction(0),
sendCoinsMenuAction(0),
usedSendingAddressesAction(0),
usedReceivingAddressesAction(0),
signMessageAction(0),
verifyMessageAction(0),
aboutAction(0),
receiveCoinsAction(0),
receiveCoinsMenuAction(0),
optionsAction(0),
toggleHideAction(0),
encryptWalletAction(0),
backupWalletAction(0),
changePassphraseAction(0),
aboutQtAction(0),
openRPCConsoleAction(0),
openAction(0),
showHelpMessageAction(0),
trayIcon(0),
trayIconMenu(0),
notificator(0),
rpcConsole(0),
prevBlocks(0),
spinnerFrame(0)
{
GUIUtil::restoreWindowGeometry("nWindow", QSize(850, 550), this);
QString windowTitle = tr("KUN KORE") + " - ";
#ifdef ENABLE_WALLET
/* if compiled with wallet support, -disablewallet can still disable the wallet */
enableWallet = !GetBoolArg("-disablewallet", false);
#else
enableWallet = false;
#endif // ENABLE_WALLET
if(enableWallet)
{
windowTitle += tr("Wallet");
} else {
windowTitle += tr("Node");
}
windowTitle += " " + networkStyle->getTitleAddText();
#ifndef Q_OS_MAC
QApplication::setWindowIcon(networkStyle->getTrayAndWindowIcon());
setWindowIcon(networkStyle->getTrayAndWindowIcon());
#else
MacDockIconHandler::instance()->setIcon(networkStyle->getAppIcon());
#endif
setWindowTitle(windowTitle);
#if defined(Q_OS_MAC) && QT_VERSION < 0x050000
// This property is not implemented in Qt 5. Setting it has no effect.
// A replacement API (QtMacUnifiedToolBar) is available in QtMacExtras.
setUnifiedTitleAndToolBarOnMac(true);
#endif
rpcConsole = new RPCConsole(0);
#ifdef ENABLE_WALLET
if(enableWallet)
{
/** Create wallet frame and make it the central widget */
walletFrame = new WalletFrame(this);
setCentralWidget(walletFrame);
} else
#endif // ENABLE_WALLET
{
/* When compiled without wallet or -disablewallet is provided,
* the central widget is the rpc console.
*/
setCentralWidget(rpcConsole);
}
// Accept D&D of URIs
setAcceptDrops(true);
// Create actions for the toolbar, menu bar and tray/dock icon
// Needs walletFrame to be initialized
createActions(networkStyle);
// Create application menu bar
createMenuBar();
// Create the toolbars
createToolBars();
// Create system tray icon and notification
//.........这里部分代码省略.........
示例4: isLButtonDown_
QDockTabBar::QDockTabBar(QWidget *parent)
:QTabBar(parent), isLButtonDown_(false),
sendDragOut_(false), insertPos_(-1)
{
setAcceptDrops(true);
}
示例5: setAcceptDrops
///Constructor
TranslucentButtons::TranslucentButtons(QWidget* parent):QPushButton(parent),m_enabled(true),m_pTimer(0),m_CurrentState(0),m_pImg(0)
{
setAcceptDrops(true);
m_CurrentColor = "black";
m_CurrentColor.setAlpha(0);
}
示例6: m_board
Window::Window(const QStringList& files)
: m_board(0)
{
setAcceptDrops(true);
resize(640, 480);
// Add statusbar
m_slider = new ZoomSlider(this);
statusBar()->addPermanentWidget(m_slider);
m_completed = new QProgressBar(this);
m_completed->setRange(0, 100);
m_completed->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Maximum);
statusBar()->addPermanentWidget(m_completed);
statusBar()->setMinimumHeight(statusBar()->sizeHint().height());
m_slider->hide();
m_completed->hide();
// Add contents
m_board = new Board(this);
connect(m_board, &Board::completionChanged, m_completed, &QProgressBar::setValue);
connect(m_board, &Board::finished, this, &Window::gameFinished);
connect(m_board, &Board::clearMessage, statusBar(), &QStatusBar::clearMessage);
connect(m_board, &Board::showMessage, statusBar(), &QStatusBar::showMessage);
connect(m_board, &Board::zoomChanged, m_slider, &ZoomSlider::setValue);
connect(m_slider, &ZoomSlider::valueChanged, m_board, &Board::zoom);
setCentralWidget(m_board);
// Add menus
QMenu* menu;
menu = menuBar()->addMenu(tr("&Game"));
QAction* choose_action = menu->addAction(tr("&Choose..."), this, SLOT(chooseGame()));
choose_action->setShortcuts(QList<QKeySequence>() << QKeySequence::New << QKeySequence::Open);
menu->addSeparator();
QAction* retrieve_pieces_action = menu->addAction(tr("&Retrieve Pieces"), m_board, SLOT(retrievePieces()), tr("Ctrl+R"));
retrieve_pieces_action->setEnabled(false);
connect(m_board, &Board::retrievePiecesAvailable, retrieve_pieces_action, &QAction::setEnabled);
menu->addSeparator();
QAction* quit_action = menu->addAction(tr("&Quit"), this, SLOT(close()), QKeySequence::Quit);
quit_action->setMenuRole(QAction::QuitRole);
menu = menuBar()->addMenu(tr("&View"));
QAction* zoom_in_action = menu->addAction(tr("Zoom &In"), m_board, SLOT(zoomIn()), tr("+"));
zoom_in_action->setEnabled(false);
connect(m_board, &Board::zoomInAvailable, zoom_in_action, &QAction::setEnabled);
QAction* zoom_out_action = menu->addAction(tr("Zoom &Out"), m_board, SLOT(zoomOut()), tr("-"));
zoom_out_action->setEnabled(false);
connect(m_board, &Board::zoomOutAvailable, zoom_out_action, &QAction::setEnabled);
m_zoom_fit_action = menu->addAction(tr("Best &Fit"), m_board, SLOT(zoomFit()));
m_zoom_fit_action->setEnabled(false);
menu->addSeparator();
m_toggle_overview_action = menu->addAction(tr("Show O&verview"), m_board, SLOT(toggleOverview()), tr("Tab"));
m_toggle_overview_action->setCheckable(true);
m_toggle_overview_action->setEnabled(false);
connect(m_board, &Board::overviewToggled, m_toggle_overview_action, &QAction::setChecked);
menu->addSeparator();
QAction* fullscreen_action = menu->addAction(tr("F&ullscreen"));
connect(fullscreen_action, &QAction::toggled, this, &Window::setFullScreen);
fullscreen_action->setCheckable(true);
#if !defined(Q_OS_MAC)
fullscreen_action->setShortcut(tr("F11"));
#else
fullscreen_action->setShortcut(tr("Ctrl+F"));
#endif
menu = menuBar()->addMenu(tr("&Settings"));
menu->addAction(tr("&Appearance..."), this, SLOT(showAppearance()));
menu->addAction(tr("&Language..."), this, SLOT(setLocale()));
menu = menuBar()->addMenu(tr("&Help"));
menu->addAction(tr("&Controls"), this, SLOT(showControls()), QKeySequence::HelpContents);
menu->addSeparator();
QAction* about_action = menu->addAction(tr("&About"), this, SLOT(showAbout()));
about_action->setMenuRole(QAction::AboutRole);
QAction* about_qt_action = menu->addAction(tr("About &Qt"), qApp, SLOT(aboutQt()));
about_qt_action->setMenuRole(QAction::AboutQtRole);
// Restore geometry
QSettings settings;
if (settings.contains("Geometry")) {
restoreGeometry(settings.value("Geometry").toByteArray());
} else {
resize(settings.value("Size", QSize(1024, 768)).toSize());
settings.remove("Size");
}
// Start or load a game
show();
chooseGame(files);
// Create auto-save timer
QTimer* timer = new QTimer(this);
connect(timer, &QTimer::timeout, m_board, &Board::saveGame);
timer->start(300000);
}
示例7: QMainWindow
BitcoinGUI::BitcoinGUI(QWidget *parent):
QMainWindow(parent),
clientModel(0),
walletModel(0),
encryptWalletAction(0),
changePassphraseAction(0),
lockWalletToggleAction(0),
aboutQtAction(0),
trayIcon(0),
notificator(0),
rpcConsole(0)
{
resize(850, 550);
setWindowTitle(tr("Boxcoin") + " - " + tr("Wallet"));
#ifndef Q_OS_MAC
qApp->setWindowIcon(QIcon(":icons/bitcoin"));
setWindowIcon(QIcon(":icons/bitcoin"));
#else
setUnifiedTitleAndToolBarOnMac(true);
QApplication::setAttribute(Qt::AA_DontShowIconsInMenus);
#endif
// Accept D&D of URIs
setAcceptDrops(true);
// Create actions for the toolbar, menu bar and tray/dock icon
createActions();
// Create application menu bar
createMenuBar();
// Create the toolbars
createToolBars();
// Create the tray icon (or setup the dock icon)
createTrayIcon();
// Create tabs
overviewPage = new OverviewPage();
transactionsPage = new QWidget(this);
QVBoxLayout *vbox = new QVBoxLayout();
transactionView = new TransactionView(this);
vbox->addWidget(transactionView);
transactionsPage->setLayout(vbox);
addressBookPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab);
receiveCoinsPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::ReceivingTab);
sendCoinsPage = new SendCoinsDialog(this);
signVerifyMessageDialog = new SignVerifyMessageDialog(this);
centralWidget = new QStackedWidget(this);
centralWidget->addWidget(overviewPage);
centralWidget->addWidget(transactionsPage);
centralWidget->addWidget(addressBookPage);
centralWidget->addWidget(receiveCoinsPage);
centralWidget->addWidget(sendCoinsPage);
setCentralWidget(centralWidget);
// Create status bar
statusBar();
// Status bar notification icons
QFrame *frameBlocks = new QFrame();
frameBlocks->setContentsMargins(0,0,0,0);
frameBlocks->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks);
frameBlocksLayout->setContentsMargins(3,0,3,0);
frameBlocksLayout->setSpacing(3);
labelEncryptionIcon = new QLabel();
labelMintingIcon = new QLabel();
labelConnectionsIcon = new QLabel();
labelBlocksIcon = new QLabel();
frameBlocksLayout->addStretch();
frameBlocksLayout->addWidget(labelEncryptionIcon);
frameBlocksLayout->addStretch();
frameBlocksLayout->addWidget(labelMintingIcon);
frameBlocksLayout->addStretch();
frameBlocksLayout->addWidget(labelConnectionsIcon);
frameBlocksLayout->addStretch();
frameBlocksLayout->addWidget(labelBlocksIcon);
frameBlocksLayout->addStretch();
// Set minting pixmap
labelMintingIcon->setPixmap(QIcon(":/icons/minting").pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
labelMintingIcon->setEnabled(false);
// Add timer to update minting icon
QTimer *timerMintingIcon = new QTimer(labelMintingIcon);
timerMintingIcon->start(MODEL_UPDATE_DELAY);
connect(timerMintingIcon, SIGNAL(timeout()), this, SLOT(updateMintingIcon()));
// Add timer to update minting weights
QTimer *timerMintingWeights = new QTimer(labelMintingIcon);
timerMintingWeights->start(30 * 1000);
connect(timerMintingWeights, SIGNAL(timeout()), this, SLOT(updateMintingWeights()));
// Set initial values for user and network weights
nWeight, nNetworkWeight = 0;
// Progress bar and label for blocks download
//.........这里部分代码省略.........
示例8: mBlogId
/** Constructor */
CreateBlogMsg::CreateBlogMsg(std::string cId ,QWidget* parent, Qt::WFlags flags)
: mBlogId(cId), QMainWindow (parent, flags)
{
/* Invoke the Qt Designer generated object setup routine */
ui.setupUi(this);
setAttribute ( Qt::WA_DeleteOnClose, true );
setupFileActions();
setupEditActions();
setupViewActions();
setupInsertActions();
setupParagraphActions();
setAcceptDrops(true);
setStartupText();
newBlogMsg();
ui.toolBar_2->addAction(ui.actionIncreasefontsize);
ui.toolBar_2->addAction(ui.actionDecreasefontsize);
ui.toolBar_2->addAction(ui.actionBlockquoute);
ui.toolBar_2->addAction(ui.actionOrderedlist);
ui.toolBar_2->addAction(ui.actionUnorderedlist);
ui.toolBar_2->addAction(ui.actionBlockquoute);
ui.toolBar_2->addAction(ui.actionCode);
ui.toolBar_2->addAction(ui.actionsplitPost);
setupTextActions();
connect(ui.actionPublish, SIGNAL(triggered()), this, SLOT(sendMsg()));
connect(ui.actionNew, SIGNAL(triggered()), this, SLOT (fileNew()));
connect(ui.actionIncreasefontsize, SIGNAL (triggered()), this, SLOT (fontSizeIncrease()));
connect(ui.actionDecreasefontsize, SIGNAL (triggered()), this, SLOT (fontSizeDecrease()));
connect(ui.actionBlockquoute, SIGNAL (triggered()), this, SLOT (blockQuote()));
connect(ui.actionCode, SIGNAL (triggered()), this, SLOT (toggleCode()));
connect(ui.actionsplitPost, SIGNAL (triggered()), this, SLOT (addPostSplitter()));
connect(ui.actionOrderedlist, SIGNAL (triggered()), this, SLOT (addOrderedList()));
connect(ui.actionUnorderedlist, SIGNAL (triggered()), this, SLOT (addUnorderedList()));
//connect(webView, SIGNAL(loadFinished(bool)),this, SLOT(updateTextEdit()));
connect( ui.msgEdit, SIGNAL( textChanged(const QString &)), this, SLOT(updateTextEdit()));
connect( ui.msgEdit, SIGNAL(currentCharFormatChanged(QTextCharFormat)),
this, SLOT(currentCharFormatChanged(QTextCharFormat)));
connect( ui.msgEdit, SIGNAL(cursorPositionChanged()),
this, SLOT(cursorPositionChanged()));
QPalette palette = QApplication::palette();
codeBackground = palette.color( QPalette::Active, QPalette::Midlight );
fontChanged(ui.msgEdit->font());
colorChanged(ui.msgEdit->textColor());
alignmentChanged(ui.msgEdit->alignment());
connect( ui.msgEdit->document(), SIGNAL(modificationChanged(bool)),
actionSave, SLOT(setEnabled(bool)));
connect( ui.msgEdit->document(), SIGNAL(modificationChanged(bool)),
this, SLOT(setWindowModified(bool)));
connect( ui.msgEdit->document(), SIGNAL(undoAvailable(bool)),
actionUndo, SLOT(setEnabled(bool)));
connect( ui.msgEdit->document(), SIGNAL(undoAvailable(bool)),
ui.actionUndo, SLOT(setEnabled(bool)));
connect( ui.msgEdit->document(), SIGNAL(redoAvailable(bool)),
actionRedo, SLOT(setEnabled(bool)));
setWindowModified( ui.msgEdit->document()->isModified());
actionSave->setEnabled( ui.msgEdit->document()->isModified());
actionUndo->setEnabled( ui.msgEdit->document()->isUndoAvailable());
ui.actionUndo->setEnabled( ui.msgEdit->document()->isUndoAvailable());
actionRedo->setEnabled( ui.msgEdit->document()->isRedoAvailable());
connect(actionUndo, SIGNAL(triggered()), ui.msgEdit, SLOT(undo()));
connect(ui.actionUndo, SIGNAL(triggered()), ui.msgEdit, SLOT(undo()));
connect(actionRedo, SIGNAL(triggered()), ui.msgEdit, SLOT(redo()));
actionCut->setEnabled(false);
actionCopy->setEnabled(false);
connect(actionCut, SIGNAL(triggered()), ui.msgEdit, SLOT(cut()));
connect(actionCopy, SIGNAL(triggered()), ui.msgEdit, SLOT(copy()));
connect(actionPaste, SIGNAL(triggered()), ui.msgEdit, SLOT(paste()));
connect(ui.msgEdit, SIGNAL(copyAvailable(bool)), actionCut, SLOT(setEnabled(bool)));
connect(ui.msgEdit, SIGNAL(copyAvailable(bool)), actionCopy, SLOT(setEnabled(bool)));
#ifndef QT_NO_CLIPBOARD
connect(QApplication::clipboard(), SIGNAL(dataChanged()), this, SLOT(clipboardDataChanged()));
#endif
//defaultCharFormat
defaultCharFormat = ui.msgEdit->currentCharFormat();
const QFont defaultFont = ui.msgEdit->document()->defaultFont();
defaultCharFormat.setFont( defaultFont );
defaultCharFormat.setForeground( ui.msgEdit->currentCharFormat().foreground() );
defaultCharFormat.setProperty( QTextFormat::FontSizeAdjustment, QVariant( 0 ) );
defaultCharFormat.setBackground( palette.color( QPalette::Active,
//.........这里部分代码省略.........
示例9: QMainWindow
BitcoinGUI::BitcoinGUI(QWidget *parent):
QMainWindow(parent),
clientModel(0),
walletModel(0),
encryptWalletAction(0),
changePassphraseAction(0),
unlockWalletAction(0),
lockWalletAction(0),
aboutQtAction(0),
trayIcon(0),
notificator(0),
rpcConsole(0)
{
resize(850, 550);
setWindowTitle(tr("StarCoin") + " - " + tr("Wallet"));
// Prevent resizing.
setFixedSize(size());
// Remove "hand" cursor from status bar.
this->statusBar()->setSizeGripEnabled(false);
// this->setStyleSheet(".BitcoinGUI { background-image: url(:/images/background-no-logo); } \
// * { color: rgb(255, 255, 255); \
// background-color: rgba(255, 255, 255, 0); \
// selection-background-color: rgb(2, 6, 150); \
// } \
// QToolTip { color: #ffffff; background-color: #2a82da; border: 1px solid white; } \
// QTableView { background-color: rgb(2, 6, 15); alternate-background-color: rgb(2, 6, 50); } \
// QHeaderView::section { \
// background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, \
// stop:0 rgb(2, 6, 15), stop: 0.5 rgb(2, 6, 70), \
// stop: 0.6 rgb(2, 6, 70), stop:1 rgb(2, 6, 15)); \
// color: white; \
// padding-left: 4px; \
// border: 1px solid #6c6c6c; \
// } \
// QFrame#frameMain, QToolButton:on { \
// background-color: rgba(11, 38, 73, 210); \
// border: 1px solid rgb(0, 186, 255); \
// border-radius: 4px; \
// } \
// QValueComboBox, QLineEdit, QDoubleSpinBox { \
// border: 1px solid rgb(2, 6, 150) \
// }\
// ");
#ifndef Q_OS_MAC
qApp->setWindowIcon(QIcon(":icons/bitcoin"));
setWindowIcon(QIcon(":icons/bitcoin"));
#else
setUnifiedTitleAndToolBarOnMac(true);
QApplication::setAttribute(Qt::AA_DontShowIconsInMenus);
#endif
// Accept D&D of URIs
setAcceptDrops(true);
// Create actions for the toolbar, menu bar and tray/dock icon
createActions();
// Create application menu bar
createMenuBar();
// Create the toolbars
createToolBars();
// Create the tray icon (or setup the dock icon)
createTrayIcon();
// Create tabs
overviewPage = new OverviewPage(this);
{
transactionsPage = new QWidget(this);
QHBoxLayout* hl = new QHBoxLayout(transactionsPage);
QFrame* frameMain = new QFrame(transactionsPage);
hl->addWidget(frameMain);
frameMain->setObjectName(QString("frameMain"));
frameMain->setFrameShape(QFrame::NoFrame);
QVBoxLayout *vbox = new QVBoxLayout(frameMain);
transactionView = new TransactionView(transactionsPage);
vbox->addWidget(transactionView);
frameMain->setLayout(vbox);
}
addressBookPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab);
receiveCoinsPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::ReceivingTab);
sendCoinsPage = new SendCoinsDialog(this);
signVerifyMessageDialog.reset(new SignVerifyMessageDialog);
centralWidget = new QStackedWidget(this);
centralWidget->addWidget(overviewPage);
centralWidget->addWidget(transactionsPage);
centralWidget->addWidget(addressBookPage);
centralWidget->addWidget(receiveCoinsPage);
centralWidget->addWidget(sendCoinsPage);
setCentralWidget(centralWidget);
// Create status bar
statusBar();
//.........这里部分代码省略.........
示例10: QMainWindow
DocumentWindow::DocumentWindow(QWidget* parent, Qt::WindowFlags flags) : QMainWindow(parent, flags)
{
setAcceptDrops(true);
}
示例11: QGraphicsRectItem
//.........这里部分代码省略.........
prevSib = 0;
}
if (el->getParent() == 0)
{
parentBlock->element->appendChild(el);
}
}
firstChild = 0;
nextSib = 0;
// set line
updateLine();
// set element
element = el;
while (!element->isImportant()) //! skip unimportant
element = (*element)[0];
element->setBlock(this);
// process rest of the AST
if (element->isLeaf()) //! leaf - create text area
{
//qDebug() << "text " << element->getType() << " par: " << element->allowsParagraphs() ;
myTextItem = new TextItem(element->getType(), this, element->allowsParagraphs(), element->isPaired());
//qDebug() << "this " << myTextItem;
}
else //! non-leaf - create rest of the tree
{
myTextItem = 0;
setToolTip(element->getType().replace("_", " "));
// int child_count = element->childCount();
QList<TreeElement*> children = element->getChildren();
// for (int i = 0; i < child_count; i++)children.size()
for (int i = 0; i < children.size(); i++)
{
// qDebug() << "child_count " << child_count <<" size() "<< children.size() << " element:"<< element->getType();
TreeElement *childEl = children[i];
if (!childEl->isFloating()) //! create block from child element
{
new Block(childEl, this);
}
else //! create docblock form child element
{
if(TreeElement::DYNAMIC){
//! zisti ako to reprezentovat z AST-cka
//! preco sa vytvori DocBlock, ktory ma prazdny TextItem?
}else{
QString text = childEl->getText();
childEl->deleteAllChildren();
new DocBlock(text, childEl, this, group);
}
}
}
}
// set highlighting
assignHighlighting(element);
// set flags
setAcceptedMouseButtons(Qt::LeftButton);
setAcceptDrops(true);
folded = false;
edited = false;
showing = false;
moreSpace = false;
moveStarted = false;
pointed = false;
isSearchResult = false;
foldButton = 0;
level = 0;
animation = new QPropertyAnimation(this, "geometry");
animation->setDuration(200);
if (element->isSelectable())
{
setPen(QPen(QBrush(Qt::black), 2));
setAcceptHoverEvents(true);
timer = new QTimer(this);
timer->setSingleShot(true);
connect(timer, SIGNAL(timeout()), this, SLOT(acceptHover()));
}
else
{
timer = 0;
}
// set size
updateGeometry(true);
// updateFoldButton();
if (parent == 0)
setVisible(false);
}
示例12: setAcceptDrops
ColumnDropCSVView::ColumnDropCSVView(QWidget*)
{
setAcceptDrops(true);
}
示例13: QMainWindow
BitcoinGUI::BitcoinGUI(QWidget *parent):
QMainWindow(parent),
clientModel(0),
walletModel(0),
encryptWalletAction(0),
changePassphraseAction(0),
unlockWalletAction(0),
lockWalletAction(0),
aboutQtAction(0),
trayIcon(0),
notificator(0),
rpcConsole(0)
{
setFixedSize(970, 550);
setWindowTitle(tr("Silkcoin") + " " + tr("Wallet"));
qApp->setStyleSheet("QMainWindow { background:rgb(200,200,200);font-family:'Open Sans,sans-serif'; } #frame { } QToolBar QLabel { padding-top:15px;padding-bottom:10px;margin:0px; } #spacer { background:rgb(35,35,35);border:none; } #toolbar2 { border:none;width:10px; background-color:qlineargradient(x1: 0, y1: 0, x2: 0.5, y2: 0.5,stop: 0 rgb(35,35,35), stop: 1 rgb(52, 170, 220)); } #toolbar { border:none;height:100%;padding-top:20px; background: rgb(35,35,35); text-align: left; color: white;min-width:200px;max-width:200px;} QToolBar QToolButton:hover {background-color:qlineargradient(x1: 0, y1: 0, x2: 2, y2: 2,stop: 0 rgb(35,35,35), stop: 1 rgb(52, 170, 220),stop: 2 rgb(35,35,35));} QToolBar QToolButton { font-family:Century Gothic;padding-left:20px;padding-right:200px;padding-top:10px;padding-bottom:10px; width:100%; color: white; text-align: left; background-color: rgb(35,35,35) } #labelMiningIcon { padding-left:5px;font-family:Century Gothic;width:100%;font-size:10px;text-align:center;color:white; } QMenu { background: rgb(35,35,35); color:white; padding-bottom:10px; } QMenu::item { color:white; background-color: transparent; } QMenu::item:selected { background-color:qlineargradient(x1: 0, y1: 0, x2: 0.5, y2: 0.5,stop: 0 rgb(35,35,35), stop: 1 rgb(52, 170, 220)); } QMenuBar { background: rgb(35,35,35); color:white; } QMenuBar::item { font-size:12px;padding-bottom:12px;padding-top:12px;padding-left:15px;padding-right:15px;color:white; background-color: transparent; } QMenuBar::item:selected { background-color:qlineargradient(x1: 0, y1: 0, x2: 0.5, y2: 0.5,stop: 0 rgb(35,35,35), stop: 1 rgb(52, 170, 220)); }");
#ifndef Q_OS_MAC
qApp->setWindowIcon(QIcon(":icons/bitcoin"));
setWindowIcon(QIcon(":icons/bitcoin"));
#else
setUnifiedTitleAndToolBarOnMac(true);
QApplication::setAttribute(Qt::AA_DontShowIconsInMenus);
#endif
// Accept D&D of URIs
setAcceptDrops(true);
// Create actions for the toolbar, menu bar and tray/dock icon
createActions();
// Create application menu bar
createMenuBar();
// Create the toolbars
createToolBars();
// Create the tray icon (or setup the dock icon)
createTrayIcon();
// Create tabs
overviewPage = new OverviewPage();
statisticsPage = new StatisticsPage(this);
blockBrowser = new BlockBrowser(this);
poolBrowser = new PoolBrowser(this);
transactionsPage = new QWidget(this);
QVBoxLayout *vbox = new QVBoxLayout();
transactionView = new TransactionView(this);
vbox->addWidget(transactionView);
transactionsPage->setLayout(vbox);
addressBookPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab);
receiveCoinsPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::ReceivingTab);
sendCoinsPage = new SendCoinsDialog(this);
signVerifyMessageDialog = new SignVerifyMessageDialog(this);
centralWidget = new QStackedWidget(this);
centralWidget->addWidget(overviewPage);
centralWidget->addWidget(statisticsPage);
centralWidget->addWidget(blockBrowser);
centralWidget->addWidget(poolBrowser);
centralWidget->addWidget(transactionsPage);
centralWidget->addWidget(addressBookPage);
centralWidget->addWidget(receiveCoinsPage);
centralWidget->addWidget(sendCoinsPage);
setCentralWidget(centralWidget);
// Status bar notification icons
QFrame *frameBlocks = new QFrame();
frameBlocks->setStyleSheet("frameBlocks { background: rgb(35,35,35); }");
frameBlocks->setContentsMargins(0,0,0,0);
frameBlocks->setMinimumWidth(30);
frameBlocks->setMaximumWidth(30);
QVBoxLayout *frameBlocksLayout = new QVBoxLayout(frameBlocks);
frameBlocksLayout->setContentsMargins(1,0,1,0);
frameBlocksLayout->setSpacing(-1);
labelEncryptionIcon = new QLabel();
labelStakingIcon = new QLabel();
labelConnectionsIcon = new QLabel();
labelBlocksIcon = new QLabel();
frameBlocksLayout->addWidget(labelEncryptionIcon);
frameBlocksLayout->addWidget(labelStakingIcon);
frameBlocksLayout->addWidget(labelConnectionsIcon);
frameBlocksLayout->addWidget(labelBlocksIcon);
frameBlocksLayout->addStretch();
if (GetBoolArg("-staking", true))
{
QTimer *timerStakingIcon = new QTimer(labelStakingIcon);
connect(timerStakingIcon, SIGNAL(timeout()), this, SLOT(updateStakingIcon()));
timerStakingIcon->start(30 * 1000);
updateStakingIcon();
}
//.........这里部分代码省略.........
示例14: K3ListView
KonqSidebarTree::KonqSidebarTree( KonqSidebarOldTreeModule *parent, QWidget *parentWidget, ModuleType moduleType, const QString& path )
: K3ListView( parentWidget ),
m_currentTopLevelItem( 0 ),
m_scrollingLocked( false ),
m_collection( 0 )
{
d = new KonqSidebarTree_Internal;
d->m_dropMode = SidebarTreeMode;
loadModuleFactories();
setAcceptDrops( true );
viewport()->setAcceptDrops( true );
installEventFilter(this);
m_lstModules.setAutoDelete( true );
setSelectionMode( Q3ListView::Single );
setDragEnabled(true);
m_sidebarModule = parent;
m_animationTimer = new QTimer( this );
connect( m_animationTimer, SIGNAL(timeout()),
this, SLOT(slotAnimation()) );
m_currentBeforeDropItem = 0;
m_dropItem = 0;
m_bOpeningFirstChild=false;
addColumn( QString() );
header()->hide();
setTreeStepSize(15);
m_autoOpenTimer = new QTimer( this );
connect( m_autoOpenTimer, SIGNAL(timeout()),
this, SLOT(slotAutoOpenFolder()) );
connect( this, SIGNAL(doubleClicked(Q3ListViewItem*)),
this, SLOT(slotDoubleClicked(Q3ListViewItem*)) );
connect( this, SIGNAL(mouseButtonPressed(int,Q3ListViewItem*,QPoint,int)),
this, SLOT(slotMouseButtonPressed(int,Q3ListViewItem*,QPoint,int)) );
connect( this, SIGNAL(mouseButtonClicked(int,Q3ListViewItem*,QPoint,int)),
this, SLOT(slotMouseButtonClicked(int,Q3ListViewItem*,QPoint,int)) );
connect( this, SIGNAL(returnPressed(Q3ListViewItem*)),
this, SLOT(slotDoubleClicked(Q3ListViewItem*)) );
connect( this, SIGNAL(selectionChanged()),
this, SLOT(slotSelectionChanged()) );
connect(qApp->clipboard(), SIGNAL(dataChanged()),
this, SLOT(slotSelectionChanged())); // so that "paste" can be updated
connect( this, SIGNAL(itemRenamed(Q3ListViewItem*,QString,int)),
this, SLOT(slotItemRenamed(Q3ListViewItem*,QString,int)));
if (moduleType == VIRT_Folder) {
m_dirtreeDir.dir.setPath(KGlobal::dirs()->saveLocation("data","konqsidebartng/virtual_folders/"+path+'/'));
m_dirtreeDir.relDir = path;
} else {
m_dirtreeDir.dir.setPath( path );
}
kDebug(1201) << m_dirtreeDir.dir.path();
m_dirtreeDir.type = moduleType;
// Initial parsing
rescanConfiguration();
if (firstChild())
{
m_bOpeningFirstChild = true;
firstChild()->setOpen(true);
m_bOpeningFirstChild = false;
}
OrgKdeKDirNotifyInterface *kdirnotify = new OrgKdeKDirNotifyInterface(QString(), QString(), QDBusConnection::sessionBus());
kdirnotify->setParent(this);
connect(kdirnotify, SIGNAL(FilesAdded(QString)), SLOT(slotFilesAdded(QString)));
connect(kdirnotify, SIGNAL(FilesChanged(QStringList)), SLOT(slotFilesChanged(QStringList)));
connect(kdirnotify, SIGNAL(FilesRemoved(QStringList)), SLOT(slotFilesRemoved(QStringList)));
m_collection = new KActionCollection(this);
m_collection->addAssociatedWidget(this);
m_collection->setObjectName( QLatin1String("bookmark actions" ));
QAction *action = new KAction(KIcon("folder-new"), i18n("&Create New Folder..."), this);
m_collection->addAction("create_folder", action);
connect(action, SIGNAL(triggered(bool)), SLOT(slotCreateFolder()));
action = new KAction(KIcon("edit-delete"), i18n("Delete Folder"), this);
m_collection->addAction("delete", action);
connect(action, SIGNAL(triggered(bool)), SLOT(slotDelete()));
action = new KAction(KIcon("user-trash"), i18n("Move to Trash"), this);
m_collection->addAction("trash", action);
connect(action, SIGNAL(triggered(bool)), SLOT(slotTrash()));
action = new KAction(i18n("Rename"), this);
action->setIcon(KIcon("edit-rename"));
m_collection->addAction("rename", action);
connect(action, SIGNAL(triggered(bool)), SLOT(slotRename()));
action = new KAction(KIcon("edit-delete"), i18n("Delete Link"), this);
m_collection->addAction("delete_link", action);
connect(action, SIGNAL(triggered(bool)), SLOT(slotDelete()));
//.........这里部分代码省略.........
示例15: setLevelSectionData
//.........这里部分代码省略.........
ui->WorldSettings->hide();
ui->WLD_ItemProps->hide();
ui->WorldFindDock->hide();
ui->Tileset_Item_Box->hide();
ui->debuggerBox->hide();
ui->bookmarkBox->hide();
ui->menuView->setEnabled(false);
ui->menuWindow->setEnabled(true);
ui->menuLevel->setEnabled(false);
ui->menuWorld->setEnabled(false);
ui->menuTest->setEnabled(false);
ui->LevelObjectToolbar->setVisible(false);
ui->WorldObjectToolbar->setVisible(false);
ui->actionLVLToolBox->setVisible(false);
ui->actionWarpsAndDoors->setVisible(false);
ui->actionSection_Settings->setVisible(false);
ui->actionWarpsAndDoors->setVisible(false);
ui->actionWLDToolBox->setVisible(false);
ui->actionGridEn->setChecked(true);
ui->actionTilesetBox->setVisible(false);
ui->actionBookmarkBox->setVisible(false);
ui->actionDebugger->setVisible(false);
ui->actionZoomReset->setEnabled(false);
ui->actionZoomIn->setEnabled(false);
ui->actionZoomOut->setEnabled(false);
setAcceptDrops(true);
ui->centralWidget->cascadeSubWindows();
ui->centralWidget->setViewMode(GlobalSettings::MainWindowView);
ui->LevelToolBoxTabs->setTabPosition(GlobalSettings::LVLToolboxPos);
ui->WorldToolBoxTabs->setTabPosition(GlobalSettings::WLDToolboxPos);
ui->TileSetsCategories->setTabPosition(GlobalSettings::TSTToolboxPos);
ui->centralWidget->setTabsClosable(true);
muVol = new QSlider(Qt::Horizontal);
muVol->setMaximumWidth(70);
muVol->setMinimumWidth(70);
muVol->setMinimum(0);
muVol->setMaximum(MIX_MAX_VOLUME);
muVol->setValue(GlobalSettings::musicVolume);
MusPlayer.setVolume(muVol->value());
ui->EditionToolBar->insertWidget(ui->actionAnimation, muVol);
ui->EditionToolBar->insertSeparator(ui->actionAnimation);
zoom = new QLineEdit();
zoom->setValidator(new QIntValidator(0,2001));
zoom->setText("100");
zoom->setMaximumWidth(50);
zoom->setEnabled(false);
ui->LevelSectionsToolBar->insertWidget(ui->actionZoomReset,zoom);
connect(zoom, SIGNAL(editingFinished()), this, SLOT(applyTextZoom()));
connect(muVol, SIGNAL(valueChanged(int)), &MusPlayer, SLOT(setVolume(int)));
curSearchBlock.id = 0;
curSearchBlock.index = 0;